<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>航空管理系统[专家]</title>
    <%@ include file="/WEB-INF/views/common/easyui.jsp"%>
    <%@ include file="/WEB-INF/views/common/validation.jsp"%>
    <c:set var="ctx" value="${pageContext.request.contextPath}"/>
    <script type="text/javascript" src="${ctx}/static/plugins/artTemplate/template.js"></script>

    <!--导入首页启动时需要的相应资源文件(首页相应功能的 js 库、css样式以及渲染首页界面的 js 文件)-->
    <script src="${ctx}/static/plugins/easyui/common/index.js" type="text/javascript"></script>
    <link href="${ctx}/static/plugins/easyui/common/index.css" rel="stylesheet" />
    <script src="${ctx}/static/plugins/easyui/common/index-startup.js"></script>
</head>
<body>
<!-- 容器遮罩 -->
<div id="maskContainer">
    <div class="datagrid-mask" style="display: block;"></div>
    <div class="datagrid-mask-msg" style="display: block; left: 50%; margin-left: -52.5px;">
        正在加载...
    </div>
</div>
<div id="mainLayout" class="easyui-layout hidden" data-options="fit: true">
    <div id="northPanel" data-options="region: 'north', border: false" style="height: 80px; overflow: hidden;">
        <div id="topbar" class="top-bar">
            <h1 style="color:white;font-size:25px">航空管理系统[专家版]</h1>
            <div class="top-bar-right">
                <p class="name">当前用户：<span id="${name}"></span></p>
            </div>
        </div>
    </div>

    <div data-options="region: 'west', title: '菜单导航栏', iconCls: 'icon-standard-map', split: true, minWidth: 200, maxWidth: 400" style="width: 220px; padding: 1px;">
        <div id="myMenu" class="easyui-accordion" data-options="fit:true,border:false">
            <script id="menu" type="text/html">
                {{each data as p_permission}}
                {{if (p_permission.pid==0)}}
                <div title="{{p_permission.name }}" style="padding: 5px;" data-options="border:false,iconCls:'{{p_permission.icon }}'">
                    <div>
                        {{each data as c_permission}}
                        {{if (c_permission.pid==p_permission.permissionId)}}
                        <a id="btn" class="easyui-linkbutton" data-options="plain:true,iconCls:'{{c_permission.icon }}'" style="width:98%;margin-bottom:5px;" onclick="window.mainpage.mainTabs.addModule('{{c_permission.name}}','{{c_permission.url }}','{{c_permission.icon }}')">{{c_permission.name}}</a>
                        {{/if}}
                        {{/each}}
                    </div>
                </div>
                {{/if}}
                {{/each}}
            </script>
        </div>
    </div>

    <div data-options="region: 'center'">
        <div id="mainTabs_tools" class="tabs-tool">
            <table>
                <tr>
                    <td><a id="mainTabs_jumpHome" class="easyui-linkbutton easyui-tooltip" title="跳转至主页选项卡" data-options="plain: true, iconCls: 'icon-hamburg-home'"></a></td>
                    <td><div class="datagrid-btn-separator"></div></td>
                    <td><a id="mainTabs_toggleAll" class="easyui-linkbutton easyui-tooltip" title="展开/折叠面板使选项卡最大化" data-options="plain: true, iconCls: 'icon-standard-arrow-out'"></a></td>
                    <td><div class="datagrid-btn-separator"></div></td>
                    <td><a id="mainTabs_refTab" class="easyui-linkbutton easyui-tooltip" title="刷新当前选中的选项卡" data-options="plain: true, iconCls: 'icon-standard-arrow-refresh'"></a></td>
                    <td><div class="datagrid-btn-separator"></div></td>
                    <td><a id="mainTabs_closeTab" class="easyui-linkbutton easyui-tooltip" title="关闭当前选中的选项卡" data-options="plain: true, iconCls: 'icon-standard-application-form-delete'"></a></td>
                </tr>
            </table>
        </div>
        <div id="mainTabs" class="easyui-tabs" data-options="fit: true, border: false, showOption: true, enableNewTabMenu: true, tools: '#mainTabs_tools', enableJumpTabMenu: true">
            <div id="homePanel" style=" border-top:none !important;" data-options="title: '主页', iconCls: 'icon-hamburg-home'">
                <div class="easyui-layout" data-options="fit: true">
                    <div data-options="region: 'north', split: false, border: false" style="height: 33px;">
                        首页内容
                    </div>
                    <div data-options="region: 'center', border: false" style="overflow: hidden;">

                    </div>
                </div>
                <div>
                    欢迎使用左侧导航栏进行您的操作！
                </div>
            </div>
        </div>
        <div id="pwddlg"></div>
    </div>

</div>
<script>
    $.ajax({
        async:false,
        type:'post',
        url:"${ctx}/hangkong/getAllPermission",
        success: function(data){
            var menuData={data:data};
            var html = template('menu', menuData);
            $('#myMenu').html(html);
        }
    });

    //点击小图标
    $('.easyui-linkbutton').on('click', function(){
        $('.easyui-linkbutton').linkbutton({selected:false});
        $(this).linkbutton({selected:true});
    });
</script>

</body>
</html>
